package com.china08.yxyapi.api.manage.edu.platform.statistics.resourcepandect1;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.BasicQuery;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.china08.yxyapi.SystemConstant;
import com.china08.yxyapi.SystemConstant.SchoolType;
import com.china08.yxyapi.api.YxyApiBaseController;
import com.china08.yxyapi.entity.mg.statistics.SchoolUploadResourceMonth;
import com.china08.yxyapi.entity.mg.statistics.SchoolUploadResourceReport;
import com.china08.yxyapi.entity.mg.statistics.SchoolUploadResourceWeekOfYearReport;
import com.china08.yxyapi.model.YxyApiPageReqModel;
import com.china08.yxyapi.model.YxyApiRespModel;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

/**
 * 
 * @Description 资源统计列表-学校
 *
 * @Author LiuWeidong
 *
 * @Date 2017年12月20日
 *
 */
@CrossOrigin
@RestController
public class ResourceCountSchool1ListController extends YxyApiBaseController {

    @Autowired
    private MongoTemplate mt;

    @RequestMapping(value = "/api_yw/manage/edu/platform/statistics/resourcepandect1/school1/list/srh", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public Page<RespModel> precess(HttpServletRequest request, HttpServletResponse response, @RequestBody ReqModel reqModel) {

        // 当前省id
        String areaIdProvince = getProfile(request, response).getSchoolAreaIdProvince();
        // 当前市id
        String areaIdCity = getProfile(request, response).getSchoolAreaIdCity();
        // 选择市id
        String cityId = reqModel.cityId;
        // 当前县id
        String areaIdDistrict = getProfile(request, response).getSchoolAreaIdDistrict();
        // 选择县id
        String districtId = reqModel.districtId;
        String keyWord = reqModel.keyWord;
        Integer month = reqModel.month;
        Integer week = reqModel.week;
        Integer year = reqModel.year;
        Integer resOrder = reqModel.resOrder;
        Integer shareResOrder = reqModel.shareResOrder;
        Integer packOrder = reqModel.packOrder;
        Integer sharePackOrder = reqModel.sharePackOrder;
        Integer schoolBureauLevel = getProfile(request, response).getSchoolBureauLevel();

        // 排序
        Pageable pageable = null;
        if (resOrder != null && resOrder == 0) {
            pageable = reqModel.getPageable(Direction.DESC, "resCount");
        }
        if (resOrder != null && resOrder == 1) {
            pageable = reqModel.getPageable(Direction.ASC, "resCount");
        }
        if (shareResOrder != null && shareResOrder == 0) {
            pageable = reqModel.getPageable(Direction.DESC, "shareResCount");
        }
        if (shareResOrder != null && shareResOrder == 1) {
            pageable = reqModel.getPageable(Direction.ASC, "shareResCount");
        }

        if (packOrder != null && packOrder == 0) {
            pageable = reqModel.getPageable(Direction.DESC, "lectureCount");
        }
        if (packOrder != null && packOrder == 1) {
            pageable = reqModel.getPageable(Direction.ASC, "lectureCount");
        }
        if (sharePackOrder != null && sharePackOrder == 0) {
            pageable = reqModel.getPageable(Direction.DESC, "shareLectureCount");
        }
        if (sharePackOrder != null && sharePackOrder == 1) {
            pageable = reqModel.getPageable(Direction.ASC, "shareLectureCount");
        }

        // 返回字段
        BasicDBObject fieldsObject = new BasicDBObject();
        fieldsObject.put("schoolNick", true);
        fieldsObject.put("stage", true);
        fieldsObject.put("areaNameCity", true);
        fieldsObject.put("resCount", true);
        fieldsObject.put("shareResCount", true);
        fieldsObject.put("lectureCount", true);
        fieldsObject.put("shareLectureCount", true);
        fieldsObject.put("areaNameDistrict", true);

        List<SchoolUploadResourceMonth> list = null;
        List<SchoolUploadResourceWeekOfYearReport> list1 = null;
        List<SchoolUploadResourceReport> totalList = null;
        DBObject dbObject = new BasicDBObject();
        long total = 0l;

        List<RespModel> respModels = new ArrayList<RespModel>();

        // 区县
        if (schoolBureauLevel == 0) {

            // 无筛选条件
            if (month == null && week == null) {

                dbObject.put("areaIdDistrict", areaIdDistrict);

                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceReport.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                totalList = mt.find(query, SchoolUploadResourceReport.class);
                // Assert.isTrue(null != list, "无资源数据");
                if (totalList != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceReport resourceMonth : totalList) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }
                        respModels.add(respModel);
                    }
                }
            }

            // 月的数据
            else if (month != null && year == null && week == null) {

                dbObject.put("areaIdDistrict", areaIdDistrict);

                if (null != month) {
                    dbObject.put("intMonth", month);
                }
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceMonth.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                list = mt.find(query, SchoolUploadResourceMonth.class);
                // Assert.isTrue(null != list, "无资源数据");
                if (list.size() > 0) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceMonth resourceMonth : list) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.areaNameDistrict = resourceMonth.getAreaIdDistrict();
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }
                        respModels.add(respModel);
                    }
                }
            } // 月end
              // 周的
            else {

                dbObject.put("areaIdDistrict", areaIdDistrict);

                if (null != year && null != week) {
                    dbObject.put("year", year);
                    dbObject.put("week", week);
                }
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceWeekOfYearReport.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                list1 = mt.find(query, SchoolUploadResourceWeekOfYearReport.class);
                if (list1 != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceWeekOfYearReport resourceMonth : list1) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();

                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }
                        respModels.add(respModel);
                    }
                }
            }
        }
        // 市
        else if (schoolBureauLevel == 1) {
            // 无筛选条件
            if (month == null && week == null) {

                dbObject.put("areaIdCity", areaIdCity);

                // 选择区县
                if (StringUtils.isNotBlank(districtId)) {
                    dbObject.put("areaIdDistrict", districtId);
                }
                // 根据学校名称搜索
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceReport.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                totalList = mt.find(query, SchoolUploadResourceReport.class);
                // Assert.isTrue(null != list, "无资源数据");
                if (totalList != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceReport resourceMonth : totalList) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }

                        respModels.add(respModel);
                    }
                }
            }

            // 月的数据
            else if (month != null && year == null && week == null) {

                dbObject.put("areaIdCity", areaIdCity);

                // 选择月份
                if (null != month) {
                    dbObject.put("intMonth", month);
                }
                // 选择区县
                if (StringUtils.isNotBlank(districtId)) {
                    dbObject.put("areaIdDistrict", districtId);
                }
                // 根据学校名称搜索
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceMonth.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                list = mt.find(query, SchoolUploadResourceMonth.class);
                // Assert.isTrue(null != list, "无资源数据");
                if (list != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceMonth resourceMonth : list) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.areaNameDistrict = resourceMonth.getAreaIdDistrict();
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }
                        respModels.add(respModel);
                    }
                }
            } // 月end
              // 周的
            else {

                dbObject.put("areaIdCity", areaIdCity);

                // 选择周
                if (null != year && null != week) {
                    dbObject.put("year", year);
                    dbObject.put("week", week);
                }
                // 选择区县
                if (StringUtils.isNotBlank(districtId)) {
                    dbObject.put("areaIdDistrict", districtId);
                }
                // 按学校搜索
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceWeekOfYearReport.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                list1 = mt.find(query, SchoolUploadResourceWeekOfYearReport.class);
                if (list1 != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceWeekOfYearReport resourceMonth : list1) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }
                        respModels.add(respModel);
                    }
                }
            }

        }
        // 省
        else if (schoolBureauLevel == 2) {

            // 无筛选条件
            if (month == null && week == null) {

                dbObject.put("areaIdProvince", areaIdProvince);

                // 选择市
                if (StringUtils.isNotBlank(cityId)) {
                    dbObject.put("areaIdCity", cityId);
                }
                // 选择区县
                if (StringUtils.isNotBlank(districtId)) {
                    dbObject.put("areaIdDistrict", districtId);
                }
                // 根据学校名称搜索
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceReport.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                totalList = mt.find(query, SchoolUploadResourceReport.class);
                // Assert.isTrue(null != list, "无资源数据");
                if (totalList != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceReport resourceMonth : totalList) {

                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();
                        respModel.schoolName = resourceMonth.getSchoolNick();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }

                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModels.add(respModel);
                    }
                }
            }

            // 月的数据
            if (month != null && year == null && week == null) {

                dbObject.put("areaIdProvince", areaIdProvince);

                // 选择月份
                if (null != month) {
                    dbObject.put("intMonth", month);
                }
                // 选择市
                if (StringUtils.isNotBlank(cityId)) {
                    dbObject.put("areaIdCity", cityId);
                }
                // 选择区县
                if (StringUtils.isNotBlank(districtId)) {
                    dbObject.put("areaIdDistrict", districtId);
                }
                // 根据学校名称搜索
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceMonth.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                list = mt.find(query, SchoolUploadResourceMonth.class);
                // Assert.isTrue(null != list, "无资源数据");
                if (list != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceMonth resourceMonth : list) {
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            String stageName = "";
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }
                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModels.add(respModel);
                    }
                }
            } // 月end
              // 周的
            if (year != null && week != null) {

                dbObject.put("areaIdProvince", areaIdProvince);

                // 选择周
                if (null != year && null != week) {
                    dbObject.put("year", year);
                    dbObject.put("week", week);
                }
                // 选择市
                if (StringUtils.isNotBlank(cityId)) {
                    dbObject.put("areaIdCity", cityId);
                }
                // 选择区县
                if (StringUtils.isNotBlank(districtId)) {
                    dbObject.put("areaIdDistrict", districtId);
                }
                // 按学校搜索
                if (StringUtils.isNotBlank(keyWord)) {
                    Pattern queryPattern = Pattern.compile(keyWord, Pattern.CASE_INSENSITIVE);
                    dbObject.put("schoolNick", queryPattern);
                }
                Query query = new BasicQuery(dbObject, fieldsObject);

                // 总数
                total = mt.count(query, SchoolUploadResourceWeekOfYearReport.class);

                // 排序
                query.with(pageable);
                // 分页
                query.skip((pageable.getPageNumber()) * pageable.getPageSize()).limit(pageable.getPageSize());

                list1 = mt.find(query, SchoolUploadResourceWeekOfYearReport.class);
                if (list1 != null) {
                    RespModel respModel = null;
                    for (SchoolUploadResourceWeekOfYearReport resourceMonth : list1) {
                        String stageName = "";
                        respModel = new RespModel();
                        respModel.areaNameCity = resourceMonth.getAreaNameCity();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModel.areaNameDistrict = resourceMonth.getAreaNameDistrict();

                        if (resourceMonth.getStage() != null && resourceMonth.getStage().size() > 0) {
                            for (String stages : resourceMonth.getStage()) {
                                stageName += SystemConstant.SchoolType.getDescription(SchoolType.valueOf(stages)) + ",";
                            }
                            respModel.stageName = stageName.substring(0, stageName.length() - 1);
                        } else {
                            respModel.stageName = "";
                        }

                        respModel.lectureCount = resourceMonth.getLectureCount();
                        respModel.shareLectureCount = resourceMonth.getShareLectureCount();
                        respModel.resCount = resourceMonth.getResCount();
                        respModel.shareResCount = resourceMonth.getShareResCount();
                        respModel.schoolName = resourceMonth.getSchoolNick();
                        respModels.add(respModel);
                    }
                }
            }
        }

        Page<RespModel> pageRes = new PageImpl<RespModel>(respModels, pageable, total);
        return pageRes;
    }

    /* 请求参数 */
    protected static class ReqModel extends YxyApiPageReqModel {

        // 选择月份(201705)
        public Integer month;
        // 选择周(选择周时需把当前年一起传过来)
        public Integer week;
        // 当前年
        public Integer year;
        // 搜索字段（学校名）
        public String keyWord;
        // 选择市id
        public String cityId;
        // 选区县id
        public String districtId;
        // 资源数量排序 1正序0倒序
        public Integer resOrder;
        // 共享资源数排序 1正序0倒序
        public Integer shareResOrder;
        // 备课包排序 1正序0倒序
        public Integer packOrder;
        // 共享备课包排序 1正序0倒序
        public Integer sharePackOrder;

    }

    /* 响应参数 */
    protected static class RespModel extends YxyApiRespModel {

        // 市名称
        public String areaNameCity;
        // 区县名称
        public String areaNameDistrict;
        // 学校名称
        public String schoolName;
        // 学段名称
        public String stageName;
        // 资源数量
        public Long resCount;
        // 共享资源数量
        public Long shareResCount;
        // 备课包数量
        public Long lectureCount;
        // 共享备课包数量
        public Long shareLectureCount;

    }
}
